﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameEditor.Common;

namespace TaskSystemClient.SPM
{
    public class MileStone : SPMObject
    {
        private string code;
        private string name;
        private DateTime startTime;
        private DateTime endTime;
        private string manager;
        private int progress;

        [Bind("MileStoneCode")]
        public string Code
        {
            get { return code; }
            set { code = value; }
        }
        [Bind("MileStoneName")]
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        [Bind("MileStoneStartTime")]
        public DateTime StartTime
        {
            get { return startTime; }
            set { startTime = value; }
        }
        [Bind("MileStoneEndTime")]
        public DateTime EndTime
        {
            get { return endTime; }
            set { endTime = value; }
        }
        [Bind("MileStoneManager")]
        public string Manager
        {
            get { return manager; }
            set { manager = value; }
        }
        [Bind("MileStoneProgress")]
        public int Progress
        {
            get { return progress; }
            set { progress = value; }
        }
        public override bool Commit(object context)
        {
            SP.UpdateMileStone(
                code, 
                code,
                Utilities.SuppressString(name),
                startTime, 
                endTime, 
                Utilities.SuppressString(manager), 
                progress);
            return true;
        }
    }
}
